Fast RGB => YUV conversion in OpenCL?

Use int4 unless your platform can use int3. Also you can pack 5 pixels into an int16 so you are wasting 1/16 instead of 1/4 of the memory bandwidth.

Use int4 unless your platform can use int3. Also you can pack 5 pixels into an int16 so you are wasting 1/16 instead of 1/4 of the memory bandwidth. __kernel void rgb2yuv( __global int3* input, __global int3* output){ rgb = inputget_global_id(0); R = rgb.

X; G = rgb. Y; B = rgb. Z; yuv.

X = ( ( 66 * R + 129 * G + 25 * B + 128) >> 8) + 16; yuv. Y = ( ( -38 * R - 74 * G + 112 * B + 128) >> 8) + 128; yuv. Z = ( ( 112 * R - 94 * G - 18 * B + 128) >> 8) + 128; outputget_global_id(0) = yuv; }.

Along with opencl specification data type int3 doesn't exists. Page 123: Supported values of n are 2, 4, 8, and 16... In your kernel variables rgb, R, G, B, and yuv should be at least __private int4. OpenCL 1.1 added support for typen where n = 3.

However, I strongly recommend you don't use it. Different vendor implementations have different bugs, and it's not saving you anything.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions